<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			*{
				margin:0;
				padding:0;
				margin:0px auto;
			}
			#d1{
				border:1px solid red;
				width:150px;
				margin:0 auto;
				text-align: center;
			}
			#d2{
				width:400px;
				background: yellow;
				text-align: center;
				
			}
			span{
				border:1px solid blue;
				/*margin:0 auto;*/
			}
			/*让行元素居中的方式,在其父级块元素上设置text-align:center*/
		</style>
	</head>
	<body>
		<div id="d1">
			123123
		</div>
		<div id="d2">
			<span>我是行元素</span>
		</div>
		
	</body>
</html>
